load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "ts",
    srcs = [
        "db.go",
        "doc.go",
        "keys.go",
        "maintenance.go",
        "memory.go",
        "metrics.go",
        "pruning.go",
        "query.go",
        "resolution.go",
        "rollup.go",
        "server.go",
        "timespan.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/ts",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvclient/kvtenant",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/kv/kvserver/liveness",
        "//pkg/roachpb",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/storage",
        "//pkg/ts/tspb",
        "//pkg/ts/tsutil",
        "//pkg/util/encoding",
        "//pkg/util/hlc",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/mon",
        "//pkg/util/quotapool",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_grpc_ecosystem_grpc_gateway//runtime:go_default_library",
        "@org_golang_google_grpc//:go_default_library",
        "@org_golang_google_grpc//codes",
        "@org_golang_google_grpc//status",
    ],
)

go_test(
    name = "ts_test",
    size = "medium",
    srcs = [
        "db_test.go",
        "iterator_test.go",
        "keys_test.go",
        "main_test.go",
        "memory_test.go",
        "metrics_test.go",
        "model_test.go",
        "pruning_test.go",
        "query_test.go",
        "rollup_test.go",
        "server_test.go",
        "timeseries_test.go",
    ],
    embed = [":ts"],
    deps = [
        "//pkg/base",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvclient/kvcoord",
        "//pkg/kv/kvclient/kvtenant",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/multitenant/tenantcapabilities",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/settings/cluster",
        "//pkg/storage",
        "//pkg/testutils",
        "//pkg/testutils/localtestcluster",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/testcluster",
        "//pkg/ts/testmodel",
        "//pkg/ts/tspb",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/mon",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_gogo_protobuf//proto",
        "@com_github_kr_pretty//:pretty",
        "@com_github_stretchr_testify//require",
    ],
)
